import { createApp, type Plugin } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import App from './App.vue'
import router from './router'
import './styles/global.css'

const app = createApp(App)

// Element Plus 아이콘을 전역 등록합니다
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(ElementPlus)
// vue 3.5 的 Plugin 定义与 vue-router 4.5 存在签名差异，需先转换为 unknown 再断言为 Plugin
app.use(router as unknown as Plugin)

app.mount('#app')
